<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>报文列表</title>
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/icon.css">
<script type="text/javascript" src="../../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../../static/js/index.js"></script>
<link rel="stylesheet" type="text/css"	href="../../static/zTree/css/zTree.css">
<link rel="stylesheet" type="text/css"	href="../../static/zTree/css/zTreeStyle/zTreeStyle.css">
<link rel="stylesheet" type="text/css"	href="../../static/js/themes/default/easyui.css">
<script type="text/javascript"	src="../../static/zTree/js/jquery.ztree.core.js"></script>
<script type="text/javascript"	src="../../static/zTree/js/jquery.ztree.excheck.js"></script>
<script type="text/javascript"	src="../../static/zTree/js/jquery.ztree.exedit.js"></script>
<%
		String f_cc_id = request.getParameter("f_cc_id");
		String myIp = session.getServletContext().getInitParameter("img_url");
	%>
<script type="text/javascript">
	var f_cc_id = "<%=f_cc_id%>";
	var queryParams;
	function EasyuiDatagrid() {
		var curWwwPath = window.document.location.href;
        //获取主机地址之后的目录，如： uimcardprj/share/meun.jsp
        var pathName = window.document.location.pathname;
        var pos = curWwwPath.indexOf(pathName);
        //获取主机地址，如： http://localhost:8083
        var localhostPaht = curWwwPath.substring(0, pos);
        //获取带"/"的项目名，如：/uimcardprj
        var projectName = pathName.substring(0, pathName.substr(1).indexOf('/') + 1);
		$("#easyui-datagrid").datagrid({
			url: '../../industry/selectC2BascHistroyByContentId.do',
			nowrap: true,
			striped: true,
			border: false,
			fit: true,
			rownumbers:true,
			queryParams: getGueryParams(),
			columns: [[
				{field:'_parentId',title:'操作',align:'center',width:80,
					formatter:function(value,row,index){
						var str ="";
						var xmlurl=row.localXmlUrl;
						if(xmlurl){
							//杭州地址
							xmlurl=xmlurl.replace("/vol-itv/FTPROOT/KDFtpUSER1/c2xml/",localhostPaht + projectName+"/ftp/c2xml/");
							//上海地址
							//xmlurl=xmlurl.replace("/home/wwwroot/KDFtpUSER1/c2xml/",localhostPaht + projectName+"/ftp/c2xml/");
							str= '<a class="easyui-linkbutton l-btn l-btn-plain" target="_Blank" iconCls="icon-ok" href="'+xmlurl+'" plain="true" ><span class="l-btn-left"><span class="l-btn-text icon-remove l-btn-icon-left">查看</span></span></a>';
						}
				    	return str;
			    	}
				},
				{field:'id',title:'ID',align:'center',width:50},
				{field:'cspId',title:'cspId',align:'center',width:30},
				{field:'lspId',title:'lspId',align:'center',width:30},
				{field:'code',title:'code',align:'center',width:150},
				{field:'correlateId',title:'关联id',align:'center',width:60},
				{field:'result',title:'结果',align:'center',width:150},
				{field:'resultDesc',title:'描述',align:'center',width:150},
				{field:'type',title:'类型',align:'center',width:150,
					formatter:function(value,row,index){
						var str ="";
						if(value==1){
							str="传输";
						}else if(value==2){
							if(row.cspId=="ctc4"){
								str="华为回执";
							} else if(row.cspId=="302"){
								str="中兴回执";
							} else if(row.cspId=="GUANGDIAN"){
								str="广电回执";
							} else{
								str="未知回执";
							}
						}
				    	return str;
			    	}
				},
				{field:'proCreateDate',title:'创建时间',align:'center',width:150,
					formatter:function(value,row,index){
						var str="";
						if(value&&value.length>19){
							str=value.substring(0,19);
						}
				    	return str;
			    	}}
				
			]],
			singleSelect:true,
			pagination:true,
			pageList:[10,20,30,40,50],
			pageSize:10,
			toolbar: '#toolbar',
			
			onExpandRow: function(index,row){
			
			},
			onSelect: function(rowIndex,rowData) {
				
			},
			onUnselect: function(rowIndex,rowData) {
				
			},
			onCheckAll: function(rowIndex,rowData) {
				
			},
			onUncheckAll: function(rowIndex,rowData) {
			
			},
			onLoadSuccess: function(data) {
				if(data.total==-1) {
					$.messager.defaults={ok:"确定",cancel:"取消"};
					$.messager.confirm('提示', '用户尚未登录,请登录', function(r){
					if (r){
					    window.parent.location.href='/login.do';
					    return false;
					}});
				}
			}
		});
	}

	function getGueryParams(){
		return {
			f_cc_id:f_cc_id
		};
	}
	$(function(){
		new EasyuiDatagrid();
	});
</script>
</head>
<body  style="width: 100%;">
<input type="hidden" id="sessionId" value="${pageContext.session.id}" />
<table id="easyui-datagrid" title="报文列表"></table>
</body>
</html>